home *** CD-ROM | disk | FTP | other *** search
- Path: news.th-darmstadt.de!news
- From: enno@inferenzsysteme.informatik.th-darmstadt.de (Enno Sandner)
- Newsgroups: comp.lang.c++
- Subject: Re: for (int i(1); ...)
- Date: 22 Feb 1996 20:06:02 +0100
- Organization: Fachbereich Informatik, TH Darmstadt
- Sender: enno@kitz.inferenzsysteme.informatik.th-darmstadt.de
- Message-ID: <ltwx5fuqn8.fsf@kitz.inferenzsysteme.informatik.th-darmstadt.de>
- References: <4gg2j6$93g@darkstar.UCSC.EDU>
- NNTP-Posting-Host: kitz.intellektik.informatik.th-darmstadt.de
- In-reply-to: ray@cse.ucsc.edu's message of 21 Feb 1996 21:24:54 GMT
- X-Newsreader: Gnus v5.1
-
- In article <4gg2j6$93g@darkstar.UCSC.EDU> ray@cse.ucsc.edu (Ray Swartz) writes:
-
- I noticed that the syntax
-
- for (int i(1); ...)
-
- works just like
-
- for (int i = 1; ...)
-
-
- however, I've not seen this used anywhere.
-
- This seems odd to me since initializing by assignment is seen as misleading
- when applied to objects.
-
- Should
-
- for (int i(1);...)
-
-
- even be used?
-
- That's just a matter of taste, because both solutions are exactly the same.
- In general an expression like 'AClass A_obj=another_A_obj;' will perform a
- copy-construction of an 'AClass' object and won't result in construction +
- subsequent assignment.
-
- Enno
-